package com.example.cloud.model.finance;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/7/30.
 * 充值记录
 */
@Entity(name = "finance_recharge_record")
@Data
@EqualsAndHashCode(callSuper = false)
public class RechargeRecord extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 患者主键
    @Column(name = "patient_id")
    private Long patientId;
    // 会员主键
    @Column(name = "member_id")
    private Long memberId;
    // 会员名称
    @Column(name = "member_name")
    private String memberName;
    // 会员编号
    @Column(name = "member_number")
    private String memberNumber;
    // 充值金额
    @Column(name = "recharge_amount", precision = 12, scale = 2)
    private BigDecimal rechargeAmount;
    // 是否累计会员金额{0：未累计 1：累计}
    @Column(name = "is_grand")
    private int isGrand;
    // 充值平台{1: 运营平台 2：小程序}
    @Column(name = "source", columnDefinition = "INT DEFAULT 1")
    private int source;
    @Transient
    private PaymentDetails paymentDetails;
}
